#include <iostream>
#include "request.h"
#include "leader.h"

int main(int argv, char**argc)
{
    printf("************  test hello zc!!!   **************\n");
    /* add test code! */
    shared_ptr<Leader> objDirector,objManager,objGeneralManager;
	
	//创建处理者
	objDirector = make_shared<Director>("王明");
	objManager = make_shared<Manager>("赵强");
	objGeneralManager = make_shared<GeneralManager>("李波");
	
	//设置上级
	objDirector->setSuccessor(objManager);
	objManager->setSuccessor(objGeneralManager);
	
	//职责链处理请求
	shared_ptr<LeaveRequest> lr1 = make_shared<LeaveRequest>("张三",2);
	objDirector->handleRequest(*lr1);
	
	shared_ptr<LeaveRequest> lr2 = make_shared<LeaveRequest>("李四",5);
	objDirector->handleRequest(*lr2);
	
	shared_ptr<LeaveRequest> lr3 = make_shared<LeaveRequest>("王五",15);
	objDirector->handleRequest(*lr3);
	
	shared_ptr<LeaveRequest> lr4 = make_shared<LeaveRequest>("赵六",45);
	objDirector->handleRequest(*lr4);
	
    
    return 0;
}
